
*------------------------------------------------------------------------------------

clear all
macro drop _all
set more off
set matsize 10000
set maxvar 15000
set seed 404496

*------------------------------------------------------------------------------------

global path "<CHANGE THIS PATH TO THE LOCATION OF THE PARENT REPLICATION FOLDER>"

cap log close
log using "$path/log", replace
cd "$path/Code"

*------------------------------------------------------------------------------------

foreach package in estout orth_out copydesc swindex lassopack pdslasso wyoung leebounds distplot ritest ebalfit moremata {
	ssc install `package', replace
}

cap net install grc1leg2.pkg, from (http://digital.cgdev.org/doc/stata/MO/Misc/)
ado update, update

*------------------------------------------------------------------------------------

use "$path/Data/raw_uganda.dta"

do "$path/Code/lasso_varclean"
do "$path/Code/gen_variables"

save "$path/Data/working.dta", replace

*------------------------------------------------------------------------------------

use "$path/Data/working.dta", clear

cd "$path/Code"
global stars_b "star "
global stars_note "\sym{*} \(p<0.1\), \sym{**} \(p<0.05\), \sym{***} \(p<0.01\)."
global nostar ""
global stars_setup "star(* 0.1 ** 0.05 *** 0.01) "

keep if sample == 1

*------------------------------------------------------------------------------------

do estimate_full_domains

do Tables1_3_4
do Figure2
do TablesA2_B1_B2
do TablesA3_thru_A6_A9_thru_A15_C1_C2
do TablesB4_B6_thru_B14
do TablesE31_E32

*------------------------------------------------------------------------------------

use "$path/Data/raw_kenya.dta", clear
do Tables2_A7_A8_B5_C3
do FigureA1

*------------------------------------------------------------------------------------

use "$path/Data/working.dta", clear
do TableA16

use "$path/Data/working.dta", clear
do TableB3

use "$path/Data/working.dta", clear
do AppendixD

*------------------------------------------------------------------------------------

do in_text_stats

*------------------------------------------------------------------------------------

log close 
